﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

namespace BSCMFF.Web.UserControls.Evaluation
{
    /// <summary>
    /// Bonus settings.
    /// </summary>
    /// <remarks></remarks>
    public partial class BonusSettings : System.Web.UI.UserControl
    {
        private bool noCompetency;
        /// <summary>
        /// Gets or sets a value indicating whether [no competency].
        /// </summary>
        /// <value><c>true</c> if [no competency]; otherwise, <c>false</c>.</value>
        /// <remarks></remarks>
        public bool NoCompetency
        {
            get
            {
                return noCompetency;
            }
            set
            {
                noCompetency = value;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="BonusSettings"/> is enabled.
        /// </summary>
        /// <value><c>true</c> if enabled; otherwise, <c>false</c>.</value>
        /// <remarks></remarks>
        public bool Enabled 
        { 
            get
            {
                return RadSliderBonus.Enabled;
            }
            set
            {
                RadSliderBonus.Enabled = value;
            }
        }

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        /// <value>The value.</value>
        /// <remarks></remarks>
        public int Value
        {
            get
            {
                return (int)RadSliderBonus.Value;
            }
            set
            {
                RadSliderBonus.Value = value;
            }
        }
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (((CheckBox)this.Parent.FindControl("CheckBoxCompetencies")).Checked == false)
            {
                PlaceholderSlider.Visible = false;
            }
            if (((CheckBox)this.Parent.FindControl("CheckBoxPKPIs")).Checked == false)
            {
                PlaceholderSlider.Visible = false;
            }

            if (((CheckBox)this.Parent.FindControl("CheckBoxPKPIs")).Checked == true &&
                ((CheckBox)this.Parent.FindControl("CheckBoxCompetencies")).Checked == true)
            {
                PlaceholderSlider.Visible = true;
            }
        }
    }
}